import React, { useEffect } from 'react'
// import { Link } from 'react-router-dom'
import { PageHeader } from 'antd'
import Header from './../newsComponents/news-header'
import { Switch, Route } from 'react-router-dom'
import './index.scss'

import LevelOne from './levelOne'
import LevelTwo from './levelTwo'

function Com(props) {
  const routes = [
    {
      path: 'index',
      // 这里的面包屑需要根据地址栏来更新
      breadcrumbName: 'First-level Menu',
    }
  ];

  useEffect(() => {
    // 在这里请求数据,在下面渲染, 每一个li 
  }, [])

  const jumpToSearch = (c) => {
    console.log(c)
  }
  return (
    <>
      <div className="container">
        <header className='header news_contacts_header'>
          <PageHeader
            className="site-page-header"
            breadcrumb={{ routes }}
          >
            < Header props={props} rightContent='/images/search-icon.png' rightClick={jumpToSearch} title='通讯录' classNames='ant-page-header-heading-dv' /></PageHeader>
        </header>
        <div className='content news_contacts_content'>
          <Switch>
            <Route path='/news/contactsList/levelOne' component={LevelOne} />
            <Route path='/news/contactsList/levelTwo' component={LevelTwo}/>
          </Switch>
        </div>
      </div>
    </>
  )
}
export default Com